Timer

#

# 11 Timer

AGB is equipped with 4 channels of 16 bit timers.

Of these, timers 0 and 1 can be used to set the interval for the supply of data from the FIFO(s) for direct sounds A and B. This interval is set by timer overflow.

##

## 1) Timer Setting

##

## 2) Timer Control

TM*CNT [d07] Timer Operation Flag

Starts and stops the timer. A setting of 0 stops the timer, and a setting of 1 starts it.

TM*CNT [d06] Interrupt Request Enable Flag

Controls whether an interrupt request flag is generated by an overflow. No interrupt is generated with a setting of 0. An overflow does generate an interrupt if the setting is 1.

TM*CNT [d02] Count-Up Timing

With a setting of 0, count-up is performed in accordance with the prescalar specification in [d01-00]. With a setting of 1, overflow of the timer channel one number lower starts a count-up regardless of the prescalar specification.

This mode is suitable for purposes such as time measurement over relatively long periods.

The count-up timing specification is disabled for Timer 0, which counts up in accordance with the prescalar specification.

TM*CNT [d01-00] Prescalar Selection

Allows selection of a prescalar based on the system clock (16.78MHz).

Setting | Prescalar (Count-Up Interval)
00 | System clock | (59.595 ns)
01 | 64 cycles of system clock | ( 3.814 s)
10 | 256 cycles of system clock | (15.256 s)
11 | 1024 cycles of system clock | (61.025 s)